(function() {
	var date_info = document.getElementById("date-info");
	var week_info = document.getElementById('week-info')
	var week_day = [
		'星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'
	];
	var hour_time = document.getElementById("hour-time");
	var minute_time = document.getElementById("minute-time");
	var second_time = document.getElementById("second-time");

	function setTime() {
		var this_day = new Date();
		var hour = (this_day.getHours() >= 12) ?
			(this_day.getHours() - 12) : this_day.getHours();
		var minute = this_day.getMinutes();
		var second = this_day.getSeconds();
		var year = this_day.getFullYear();
		var month = ((this_day.getMonth() + 1) < 10) ?
			"0" + (this_day.getMonth() + 1) : (this_day.getMonth() + 1);
		var date = (this_day.getDate() < 10) ?
			"0" + this_day.getDate() : this_day.getDate();
		var day = this_day.getDay();
		date_info.innerHTML =
			year + "." + month + "." + date;
		week_info.innerHTML = week_day[day];
		hour_time.innerHTML = (this_day.getHours() < 10) ?
			"0" + this_day.getHours() : this_day.getHours();
		minute_time.innerHTML = (this_day.getMinutes() < 10) ?
			"0" + this_day.getMinutes() : this_day.getMinutes();
		second_time.innerHTML = (this_day.getSeconds() < 10) ?
			"0" + this_day.getSeconds() : this_day.getSeconds();
	}
	setInterval(setTime, 1000);
})();


